﻿using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class GameMessage : MonoBehaviour {

    public static GameMessage _instance;
    public Text Message;
    public Text Round;

    void Awake()
    {
        _instance = this;
        this.gameObject.SetActive(false);
    }


    public void ShowText(string text)
    {
        this.gameObject.SetActive(true);
        Message.text = text;
        Round.text = TurnGame._instance.Round.ToString();
        StartCoroutine("HideText");
    }

    IEnumerator HideText()
    {
        yield return new WaitForSeconds(2f);
        this.gameObject.SetActive(false);
    }
}
